With the gradual application and popularity of various terminals, requirements on functions of the terminals are increasingly higher.
Using face image recognition as an example, a face recognition algorithm has already existed in the existing technology. For the face image recognition, similarity between all samples needs to be calculated, so as to determine a user category corresponding to a test image. However, in the field of Internet, because a collecting environment of a registered user is usually greatly different from a collecting environment of a recognized user, so that a same face image presents different modes, resulting in that the face recognition rate is reduced.
Besides, a face verification technology can improve the face recognition rate. Different from the foregoing face image recognition, in face verification, a template library only has a template image of a single user, which is used to determine whether a user corresponding to a test image is the same as that corresponding to the template image.
In an existing face verification technology, principal component on linear discriminant analysis (PCLDA) is mainly used to obtain an identifiable feature of an image, to calculate similarity between a template image feature and a test image feature, and then the similarity is compared with a preset threshold to verify a user corresponding to the test image. For example, it is assumed that after gray normalization, brightness normalization, and feature extraction of all face images, feature vectors of all the face images are xεRd; the algorithm specifically includes:
(1) Training steps: Calculate, according to training samples labeled with category information, an average value μk (k=1, 2 . . . n) of each category of the samples, an average value μ of all the samples, and an intra-class covariance matrix Sw (a sum of covariance matrices of all categories) and an inter-class covariance matrix Sb (a covariance matrix of an average value of all categories). Via linear discriminant analysis (LDA), a projection matrix v of an original feature is obtained, the inter-class covariance matrix Sb is maximized, and the intra-class covariance matrix Sw is minimized.
  v  =      max    ⁢          {              v        |                                            v              T                        ⁢                          S              b                        ⁢            v                                              v              T                        ⁢                          S              w                        ⁢            v                              }      
In a specific implementation process, because a dimension of an original feature is usually relatively high, before the LDA is performed, principal component analysis (PCA) usually needs to be performed on the feature to reduce the dimension and obtain a main feature pattern.
(2) Testing steps: Project, according to the projection matrix v, an original test sample, to obtain y=vx, then calculate similarity between a template image feature ym and a test image feature yp, and obtain a verification result by comparing the similarity with a preset threshold.
However, it is found that the existing technology at least has the following technical problems: Because a category corresponding to the sample needs to be determined, and whether two samples belong to a same category is not determined, the recognition efficiency is low; moreover, under an uncontrolled collecting environment, because a relatively big difference exists between intra-class samples corresponding to a same user, an identifiable feature based on intra-class and inter-class information cannot fully describe the original sample feature, and meanwhile, a recognition accuracy rate of a face image is low.
Therefore, technical problems in the existing technology that, because a category corresponding to a sample needs to be determined, and a difference between intra-class samples corresponding to a same user is relatively big, the recognition efficiency of a face image is low, need to be solved.